package com.bbz.core.sort;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Collections.sort方法底层就是调用的array.sort方法，而且不论是Collections.sort或者是Arrays.sort方法
 * 
 * @author binbin.a.zhang
 *
 */
public class CollectionsSortDemo {
	public static void main(String args[]) {
		List<Student> list = Arrays.asList(new Student("tom", 1, 88, 45), new Student("tom1", 9, 88, 45),
				new Student("tom5", 2, 88, 45), new Student("tom4", 3, 88, 45), new Student("tom3", 6, 88, 45));
		SortByNumber sortByNumber = new SortByNumber();
		Collections.sort(list, sortByNumber);
		System.out.println("根据学生编号由低到高排序：");
		for (Student student : list) {
			System.out.println(student);
		}

	}

}
